from pydantic import ConfigDict

from app.models import BaseDevice
from app.models.base import IdType, SQLBaseModel
from app.utils.decorators.optional import optional


class DeviceCreate(BaseDevice):
    user_id: IdType

@optional(without_fields=["id"])
class DeviceUpdate(DeviceCreate):
    id: IdType

class DeviceOut(SQLBaseModel, DeviceCreate):
    model_config = ConfigDict(from_attributes=True)

class DeviceExport(DeviceOut):
    model_config = ConfigDict(from_attributes=True)